<template>
<header>
    <div class="header-top">
      <div class="header-wrap">
        <div class="header-user">
          <span>尚品汇欢迎您！</span>
          <span>请<router-link to="/login">登陆</router-link>
            <router-link to="/register">免费注册</router-link>
          </span>
        </div>
        <ul class="header-nav">
          <li>我的订单</li>
          <li>我的购物车</li>
          <li>我的尚品汇</li>
          <li>尚品汇会员</li>
          <li>企业采购</li>
          <li>关注尚品汇</li>
          <li>合作招商</li>
          <li>商家后台</li>
        </ul>
      </div>
    </div>
    <div class="header-bottom header-wrap">
      <router-link to="/home">
      <img src="./images/logo.png" alt="logo" class="header-logo">
      </router-link>
      <form @submit.prevent="toSearch">
        <input type="text" class="header-input">
        <button class="header-btn">搜索</button>
      </form>
    </div>
  </header>
</template>

<script>
export default {
  name: "XHeader",
  methods:{
  toSearch(){
    this.$router.push("/search")
  },
},
};
</script>

<style> 
.header-top {
  height: 30px;
  background-color: #eaeaea;
}
.header-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 1200px;
  height: 100%;
  margin: 0 auto;
}
.header-nav {
  display: flex;
}
.header-nav li {
  border-right: 1px solid #b3aeae;
  padding-right: 10px;
  margin-right: 10px;
  cursor: pointer;
}
.header-nav li:last-child {
  border-right: none;
  padding-right: 0;
  margin-right: 0;
}
.header-bottom {
  height: 100px;
}
.header-form {
  display: flex;
  align-items: center;
}
.header-input {
  width: 500px;
  height: 30px;
  border: 2px solid #ea4a36;
  outline: none;
  padding: 0 5px;
}
.header-btn {
  width: 80px;
  height: 34px;
  border: none;
  background-color: #ea4a36;
  color: #fff;
  cursor: pointer;
}
</style>